﻿<UserControl x:Class="FileAdapters.RetransmissionStatPicker"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:uc="clr-namespace:GSF.TimeSeries.UI.UserControls;assembly=GSF.TimeSeries.UI.WPF"
             xmlns:ui="clr-namespace:FileAdapters"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             Width="500">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/GSF.TimeSeries.UI.WPF;Component/Resources/CommonResource.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <ui:RetransmissionStatViewModel x:Key="ViewModel" />
        </ResourceDictionary>
    </UserControl.Resources>
    
    <Grid DataContext="{StaticResource ViewModel}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        
        <Label Grid.Row="0" Grid.Column="0" Content="Original Value" />
        <TextBox Grid.Row="0" Grid.Column="1" Name="OriginalValueTextBox" Width="{StaticResource XLargeItemSize}" IsReadOnly="True" />

        <Label Grid.Row="1" Grid.Column="0" Content="New Value" />
        <TextBox Grid.Row="1" Grid.Column="1" Name="NewValueTextBox" Width="{StaticResource XLargeItemSize}" />

        <StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,10,0,0" Orientation="Horizontal">
            <CheckBox Content="Filter by signal index " IsChecked="{Binding Mode=TwoWay, Path=UseFilterExpression}" />
            <TextBox Width="{StaticResource XXXSmallItemSize}" HorizontalContentAlignment="Center" Text="{Binding Mode=TwoWay, Path=SignalIndex}" IsEnabled="{Binding UseFilterExpression}" />
        </StackPanel>

        <uc:MeasurementPagerUserControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Name="MeasurementPager" ItemsPerPage="18" FilterExpression="{Binding FilterExpression}" Selectable="False" Searchable="True" CurrentItemChanged="MeasurementPager_CurrentItemChanged" Button.Click="MeasurementPager_ButtonClick">
            <uc:MeasurementPagerUserControl.DataGridColumns>
                <DataGridTextColumn Header="ID" Width="2*" Binding="{Binding ID}" IsReadOnly="True">
                    <DataGridTextColumn.CellStyle>
                        <Style TargetType="DataGridCell">
                            <Setter Property="ToolTip" Value="{Binding SignalReference}" />
                        </Style>
                    </DataGridTextColumn.CellStyle>
                </DataGridTextColumn>
                <DataGridTextColumn Header="Description" Width="9*" Binding="{Binding Description}" IsReadOnly="True">
                    <DataGridTextColumn.CellStyle>
                        <Style TargetType="DataGridCell">
                            <Setter Property="ToolTip" Value="{Binding Description}" />
                        </Style>
                    </DataGridTextColumn.CellStyle>
                </DataGridTextColumn>
            </uc:MeasurementPagerUserControl.DataGridColumns>
        </uc:MeasurementPagerUserControl>
        
        <StackPanel Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Margin="5" Content="OK" IsDefault="True" Click="OKButton_Click" />
            <Button Margin="5" Content="Cancel" IsCancel="True" />
        </StackPanel>
    </Grid>
</UserControl>
